#pragma once
#include "Entity.h"
#include "AniSprite.h"

class PlayerState;


//Player Class
class Player : public Entity
{
	//Allow Player state to access our private parts
	friend class PlayerState;

public:
	//Create Player, default location (0,0)

	friend class PlayerState;

public:
	Player(sf::Vector2f Position = sf::Vector2f(0,0));
	~Player();

	//Player init
	void Init();

	//Update Logic
	void Update();

	//Render
	void Draw();

	//Change Player State
	void ChangeState(PlayerState * state);

	//Change Current Animation
	void ChangeAnim(std::string newAnim,float speed = 1.0f);
	//Set Animation Speed
	void AnimSpeed(float fps);


	//Flip Player Sprite
	void Flip(bool flip = true);

	//Physics commands
	//Apply Force
	void ApplyForce(sf::Vector2f force);
	//Apply Force as an Impulse
	void ApplyForceImpulse(sf::Vector2f force);

	bool AniComplete();

	sf::Vector2f GetVelocity();


private:

	float Health;

	AniSprite * curAnim;

	sf::Image * curSheet;

	PlayerState* sState;

	b2Body * bPlayerBody;

	bool bFlipped;
};



